﻿#pragma once
#include <QString>
#include <QObject>

class PubTopicInfoEntity : public QObject
{
	Q_OBJECT

public:
	PubTopicInfoEntity(QObject* parent = nullptr) : QObject(parent), m_id(-1), m_name(""), m_topic(""), m_qos(0), m_payload(""), m_hex(false), m_description("") {}

	PubTopicInfoEntity(const PubTopicInfoEntity& other)
	{
		m_id = other.m_id;
		m_name = other.m_name;
		m_topic = other.m_topic;
		m_qos = other.m_qos;
		m_payload = other.m_payload;
		m_hex = other.m_hex;
		m_description = other.m_description;
	}

	// get set
	int id() const { return m_id; }
	void setId(int id) { m_id = id; }

	QString name() const { return m_name; }
	void setName(const QString& name) { m_name = name; }

	QString topic() const { return m_topic; }
	void setTopic(const QString& topic) { m_topic = topic; }

	int qos() const { return m_qos; }
	void setQos(int qos) { m_qos = qos; }

	QString payload() const { return m_payload; }
	void setPayload(const QString& payload) { m_payload = payload; }

	bool hex() const { return m_hex; }
	void setHex(bool hex) { m_hex = hex; }

	QString description() const { return m_description; }
	void setDescription(const QString& description) { m_description = description; }

private:
	// id
	int m_id;
	// name
	QString m_name;
	// topic
	QString m_topic;
	// qos
	int m_qos;
	// payload
	QString m_payload;
	// hex
	bool m_hex;
	//description
	QString m_description;
};

